from django.urls import path, re_path
from doctors import views
from rest_framework.routers import DefaultRouter

router = DefaultRouter()
router.register('search',views.DoctorSearchView,basename="search")

urlpatterns = [
    # 地域查询
    path('province/', views.ProvinceView.as_view()),
    re_path(r'^city/(?P<provinceID>\d+)/$', views.CityView.as_view()),
    re_path(r'^doccity/(?P<cityID>\d+)/$',views.CityDocView.as_view()),

    # 科室
    path('category/', views.DepartmentCategoryView.as_view()),
    re_path(r'^department/(?P<de_categoryID>\d+)/$', views.DepartmentView.as_view()),

    # 医生
    re_path(r'^doctor/(?P<departmentID>\d+)/$', views.DoctorView.as_view()),
    re_path(r'^docdetail/(?P<doctorID>\d+)/$',views.DoctorDetailView.as_view()),
    # re_path(r'^dochos/(?P<hospitalID>\d+)/$',views.DoctorByHospitalView.as_view()),

    # 医院
    re_path(r'^hospital/(?P<departmentID>\d+)/$', views.HospitalView.as_view()),
    re_path(r'^hosdetail/(?P<hospitalID>\d+)/$', views.HospitalDetailView.as_view()),

    # 疾病
    re_path(r'^treat/(?P<departmentID>\d+)/$', views.TreatmentView.as_view()),
    re_path(r'^treatdetail/(?P<treatmentID>\d+)/$', views.TreatmentDetailView.as_view()),


    # 检查
    path('opcategory/',views.OperationCategoryView.as_view()),
    re_path(r'^operation/(?P<opcategoryID>\d+)/$',views.OperationView.as_view()),
    re_path(r'^opdetail/(?P<operationID>\d+)/$',views.OperationDetailView.as_view()),

    # 问答
    re_path(r'^question/(?P<departmentID>\d+)/(?P<treatmentID>\d+)/$',views.QuestionListView.as_view()),
    re_path(r'^ask/(?P<questionID>\d+)/$',views.QuestionDetailView.as_view()),
    re_path(r'^answer/(?P<questionID>\d+)/$',views.AnswerListView.as_view()),

    # 问答
    re_path(r'^questionabc/(?P<treatmentID>\d+)/(?P<doctorID>\d+)/$',views.QuestionView.as_view()),
    re_path(r'^answerabc/(?P<questionID>\d+)/(?P<doctorID>\d+)/$',views.AnswerView.as_view()),

    ]+router.urls